<template>
	<view class="login-box ss-flex-col ss-col-center ss-row-center">
		<z-image :src="setting?.logo_url" width="96rpx" height="96rpx"></z-image>
		<view class="font-color-text ss-font-36 bold ss-m-t-8">{{ setting?.name }}</view>
		<view class="ss-flex ss-m-t-64 ss-m-b-32">
			<uv-checkbox-group size="32rpx" labelSize="32rpx" labelColor="#666666" v-model="state.checkboxValue">
				<uv-checkbox activeColor="#49961F" shape="circle" v-for="(item, index) in state.checkboxList"
					:key="index" :label="item.name" :name="item.name"></uv-checkbox>
			</uv-checkbox-group>
			<view @tap="sheep.$router.go('/pages/app/parsePage',{key:'PrivacyAgreementTerms'})" class="font-color-price ss-font-32">《隐私协议》</view>
			<view class="font-color-subtext ss-font-32">和</view>
			<view @tap="sheep.$router.go('/pages/app/parsePage',{key:'userAgreement'})" class="font-color-price ss-font-32">《用户协议》</view>
		</view>
		<z-button @tap="login" width="560" radius='8'>一键授权登录</z-button>
	</view>
</template>

<script setup>
	import sheep from "@/sheep"
	const state = reactive({
		checkboxValue: [],
		checkboxList: [{
			name: '我已阅读并同意',
			label:'我已阅读并同意',
			disabled: false
		}],
		code:''
	})
	const setting = computed(() => sheep.$store('app').setting.setting)
	async function login(){
		if(!state.checkboxValue.length) return sheep.$helper.toast('请认真阅读并同意《隐私协议》和《用户协议》')
		sheep.$store('user').login()
	}
</script>

<style lang="scss" scoped>
	.login-box {
		width: 100%;
		// height: 526rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		padding: 40rpx 0;
	}
</style>